//***********************************************************************
//	File:		Play.h
//	Author:		
//	Course:		SGP 1405
//	Purpose:	
//***********************************************************************
//***********************************************************************
//	Purposfully left blank for all comments regarding this file 
//	
//	
//	
//***********************************************************************


#pragma once
#include "IGameState.h"
#include "../SGD Wrappers/SGD_Handle.h"
#include "../SGD Wrappers/SGD_Geometry.h"
#include "../SGD Wrappers/SGD_Declarations.h"
#include "../GameObjects/PlayListener.h"

#include "../TinyXML/tinyxml.h"

class Player; 

class Entity;
class EntityManager; 

class Play :
	public IGameState
{
public:
	enum levels {LEVEL_P1TUTORIAL, LEVEL_P2TUTORIAL,
				 LEVEL_1, LEVEL_2, LEVEL_3};

	enum buckets {PLAYERS, ENEMIES, PROJECTILES, ABILITIES, OBJECTS};

	static Play* GetInstance(void);

	virtual void	Enter(void);
	virtual void	Exit(void);

	virtual bool	Input(void);
	virtual void	Update(float dt);
	virtual void	Render(void);

	/**********************************************************/
	// Camera Accessors
	SGD::Rectangle	GetCameraRect	( void ) const;
	SGD::Point		GetCameraPos	( void ) const;
	SGD::Point		GetScreenSize	( void ) const;

	/**********************************************************/
	// Player accessor (NOT CONST FOR PLAYLISTENER INCREASE SCORE)
	Player*			GetPlayer		( void );

	/**********************************************************/
	// Game Paused Accessor
	bool GetGamePaused(void) const { return m_bGamePaused; }

private:
	Play() = default;
	Play(const Play&) = delete; 
	Play& operator =(const Play&) = delete; 

	/**********************************************************/
	// Event & Message Managers
	SGD::EventManager*		m_pEvents = nullptr;
	SGD::MessageManager*	m_pMessages = nullptr;

	/**********************************************************/
	// Entity Manager
	EntityManager*			m_pEntities = nullptr; 

	// Message Callback Function:
	static void MessageProc(const SGD::Message* pMsg);

	
	/**********************************************************/
	// Camera Accessors, Mutators & Variables
	SGD::Point		m_ptCameraPos		= SGD::Point{0,0};
	SGD::Point		m_ptWorldSize		= SGD::Point{800, 600};


	/**********************************************************/
	// Game Entities that we know exist 
	Player* m_pPlayer1; 
	Player* m_pPlayer2; 


	/**********************************************************/
	// Game's Listener
	PlayListener * m_pListener;

	/**********************************************************/
	// Is the game paused 
	bool m_bGamePaused = false; 

};

